#ifndef DECAYEDEXCEPTION_H
#define DECAYEDEXCEPTION_H

#include "dateTime.h"
#include "vector.h"

#include <stdexcept>
#include <string>

namespace libsgp4
{

/**
 * @brief The exception that the SGP4 class throws when a satellite decays.
 * 当卫星衰败的时候，SGP4抛出此异常。
 */
class DecayedException : public std::runtime_error
{
public:
    /**
     * Constructor
     * @param[in] dt time of the event
     * @param[in] pos position of the satellite at dt
     * @param[in] vel velocity of the satellite at dt
     * dt,事件的时间；pos,在dt时卫星的位置；vel,在dt时卫星的速度
     */
    DecayedException(const DateTime& dt, const Vector& pos, const Vector& vel)
        : runtime_error("Satellite decayed")
        , _dt(dt)
        , _pos(pos)
        , _vel(vel)
    {
    }

    /**
     * @returns the date
     */
    DateTime Decayed() const
    {
        return _dt;
    }

    /**
     * @returns the position
     */
    Vector Position() const
    {
        return _pos;
    }

    /**
     * @returns the velocity
     */
    Vector Velocity() const
    {
        return _vel;
    }

private:
    DateTime _dt;
    Vector _pos;
    Vector _vel;
};

} // namespace libsgp4

#endif // DECAYEDEXCEPTION_H
